#ifndef __SOCKETD_H__
#define __SOCKETD_H__

#include "game_socket.h"
#include "game_log.h"

class Socketd:public CGameSocketd{
private:
  CGameLogger* _logger;
public:
  void run();
  BOOL init(int port);
  void onAccept(int fd, short events, void* arg);
};



class Client:public CGameSocketd::Connection{
private:
  CGameLogger* _logger;
protected:
  virtual void onClose();
  void onRead(bufferevent* bev);
  void onEvents(bufferevent* bev,short events);
public:
  Client(CGameSocketd* socketd):CGameSocketd::Connection(socketd){};
  BOOL init(sockfd_t fd,event_base* evbase,const sockaddr_in& sa);
};


#endif
